<template>
    <table-dialog ref="dialogRef" title="人员考核" width="85%" :showFooter="false">
        <template #default>
            <div class="mod-home">
                <table-grid
                    ref="sxTableRef"
                    style="height: 100%;"
                    :button-list="buttonList"
                    tableTitle="人员考核"
                    :tableColumn="bmTableColumn"
                    :tableData="bmTableData"
                    @btnClick="sxBtnClick"
                ></table-grid>
            </div>
        </template>
    </table-dialog>
</template>

<script>
export default {
	data () {
		return {
			dialogTableVisible: false,
			buttonList: [
                {name: "保存",code: "save",type: "success"},
			],
			bmTableColumn: [
				{type: 'seq', width: 60},
				{type: 'checkbox', width: 50},
				{field: 'person', title: '人员', },
				{field: 'part', title: '所属部门'},
				{field: 'quyu', title: '区域'},
				{field: 'score', title: '考核得分', editRender: {name: 'VxeInput', props: { clearable: true }}},
				{field: 'zy', title: '注意事项', editRender: {name: 'VxeInput', props: { clearable: true }}},
				{field: 'yj', title: '考评意见', editRender: {name: 'VxeInput', props: { clearable: true }}},
				{field: "ctrl", title: "操作", fixed:"right", width: 100,
					slots: {default: ({ row, column }) => {
							return [
								<div>
									<el-button size="small" type="primary">历史分值</el-button>
								</div>
							]
						},
					}
				},
			],
			bmTableData: [
				{
                    person: "张三",
                    part: "业务一部",
                    quyu: "区域1",
					code: "somthing001",
					name: "事项名称001",
					jhsj: "2025-02-28 14:00",
                    type: "跟踪",
					hk: "未开始",
					fy: 2000,
				},
				{
                    person: "张三",
                    part: "业务一部",
                    quyu: "区域1",
					code: "somthing002",
					name: "事项名称002",
                    jhsj: "2025-02-28 14:00",
                    type: "跟踪",
					hk: "进行中",
					fy: 2000,
				},
			],
		}
	},
	mounted () {

	},
	methods: {
		init(){
			this.$refs.dialogRef.openDialog();
		},
        sxBtnClick(btn){
            switch (btn.code) {
                case "add":
                    this.$refs.sxTableRef.insert();
            }
        },
	}
}
</script>

<style lang="scss" scoped>
.mod-home{
	display: flex;
	justify-content: space-between;
	background-color: #f1f1f1;
}

</style>
